
#import csv
#
#
#with open('/etc/ansible/users.csv', 'r') as f:
#    reader = csv.DictReader(f)
#    for row in reader:
#        print("row")
#
import csv
users = {}
with open('/etc/ansible/users.csv', 'r') as csvfile:
    csv_reader = csv.reader(csvfile)  # 使用csv.reader读取csvfile中的文件
    header = next(csv_reader)        # 读取第一行每一列的标题
    for row in csv_reader:            # 将csv 文件中的数据保存到data中
        #data.append(row[0]
        for index in row:
            info = index.split(";")
            users[info[1]] = info[2]
           # users[row['username']] = row['password']
           # print(info[1],info[2])           # 选择某一列加入到data数组中
   # print(data)
    print(users)
